Fix Bug: Group photo url error

Brightcells 7 jaren geleden
bovenliggende
commit
d247cf9e73
2 gewijzigde bestanden met toevoegingen van 5 en 3 verwijderingen
  1. 3 1
      group/models.py
  2. 2 2
      requirements.txt

+ 3 - 1
group/models.py

@@ -6,6 +6,7 @@ from shortuuidfield import ShortUUIDField
6 6
 from TimeConvert import TimeConvert as tc
7 7
 
8 8
 from pai2.basemodels import CreateUpdateMixin
9
+from photo.models import PhotosInfo
9 10
 from utils.qiniucdn import qiniu_file_url
10 11
 from utils.redis.rgroup import get_group_photo_thumbup_flag
11 12
 from utils.redis.rorder import get_lensman_order_record
@@ -261,7 +262,8 @@ class GroupPhotoInfo(CreateUpdateMixin):
261 262
 
262 263
     @property
263 264
     def photo_url(self):
264
-        return qiniu_file_url(self.photo_path, bucket='photo')
265
+        bucket = 'watermark' if PhotosInfo.objects.filter(p_photo_path=self.photo_path).exists() else 'photo'
266
+        return qiniu_file_url(self.photo_path, bucket=bucket)
265 267
 
266 268
     @property
267 269
     def photo_thumbnail_url(self):

+ 2 - 2
requirements.txt

@@ -19,7 +19,7 @@ django-rlog==1.0.7
19 19
 django-shortuuidfield==0.1.3
20 20
 django-six==1.0.2
21 21
 django-uniapi==1.0.0
22
-django-we==1.0.4
22
+django-we==1.0.7
23 23
 djangorestframework==3.6.3
24 24
 furl==1.0.0
25 25
 hiredis==0.2.0
@@ -31,7 +31,7 @@ pysnippets==1.0.4
31 31
 pywe-jssdk==1.0.2
32 32
 pywe-miniapp==1.0.0
33 33
 pywe-oauth==1.0.4
34
-pywe-pay==1.0.6
34
+pywe-pay==1.0.7
35 35
 pywe-pay-notify==1.0.1
36 36
 pywe-response==1.0.1
37 37
 pywe-sign==1.0.6